<template>
  <el-dialog
    title="试卷详情"
    :visible="dialogVisible"
    @close="dialogVisible = false"
    width="80%"
  >
    <div >
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="卷名">
          <el-input v-model="form.examinationPlanName"></el-input>
        </el-form-item>
        <el-form-item label="及格分数">
          <el-input v-model="form.passScore"></el-input>
        </el-form-item>
        <el-form-item label="总分数">
          <el-input v-model="form.totalScore"></el-input>
        </el-form-item>
      </el-form>
    </div>
    <div>
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="课件" name="first">
          <el-table :data="courseList">
            <el-table-column prop="courseName" label="课件"> </el-table-column>
            <el-table-column prop="courseSecond" label="时长">
              <template slot-scope="scope">
                {{ formatDuration(scope.row.courseSecond) }}
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="题目" name="second">
          <div style="height: 500px; overflow-y: auto;">
            <el-table :data="questionList" align="center" style="width: 100%;height:100%">
            <el-table-column prop="questionName" label="题名">
            </el-table-column>
          </el-table>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>
  </el-dialog>
</template>
<script>
import { getExaminationPlanInfo } from "@/api/train/index.js";
export default {
  components: {
  },
  data() {
    return {
      dialogVisible: false,
      courseList: [],
      questionList: [],
      form: {},
      activeName: "first",
    };
  },
  mounted() {
  
  },
  methods: {
   
    //显示弹窗
    show(row) {
      console.log(row)
      this.dialogVisible = true;
      getExaminationPlanInfo({
        examinationPlanId: row.examinationPlanId,
      }).then((res) => {
        console.log(res);
        this.form = res.data;
        this.courseList = res.data.courseList;
        this.questionList = res.data.questionList;
      });
    },
    handleClick() {},
    //关闭弹窗
    handleClose() {
      this.dialogVisible = false;
    },
  },
};
</script>
<style scoped></style>
